<head>
	<link rel="stylesheet" type="text/css" href="profile_inner.css" />
	<link rel="stylesheet" type="text/css" href="../common/gallery/gallery_compact.css" />
</head>

<img src="/img/icons/back.gif"><a href="frame.php?page=profile"> Return to profile </a>

<div class="padded_text">

<div class="head">Users Tagging Me</div>

<br /><img src="/img/arrow_blue.gif" /> <a href="frame.php?page=taggedusers">View my tagged users</a>

<?php

	error_reporting(0);
	session_start();
	error_reporting(1);
	
	require_once "../common/PinSQL.obj";
	$pinSQL = new PinSQL();
	$pinSQL2 = new PinSQL();
	
	$username = $_SESSION['username'];
	$id = $_SESSION['id'];
	
	$pinSQL->Query("SELECT * FROM memberdata WHERE tagged_users='$username'
	OR tagged_users LIKE '%,$username'
	OR tagged_users LIKE '$username,%'
	OR tagged_users LIKE '%,$username,%' ");
	
?>
<p />You are currently tagged by <?php echo $pinSQL->GetNumRows(); ?> users:
<br />
<?php
	
	while ( $row = $pinSQL->FetchNextRow() )
	{
		
		$pinSQL2->Query("SELECT * FROM members WHERE id='" . $row['id'] . "'");
		$row2 = $pinSQL2->FetchNextRow();
		
?>

	<br /><img src="/img/user_incoming_tag.png" /> <a href="/members/frame.php?page=profile&user=<?php echo $row2['username']; ?>" target="_top"><?php echo $row2['username']; ?></a>
	<span class="small"><?php echo $row2['firstname']; ?> <?php echo $row2['lastname']; ?></span>

<?php
		
	}
?>

</div>